home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13803 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: Re: C coding problem
  5. Date: 10 Apr 1996 07:11:42 -0500
  6. Organization: TU Wien
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4kg8hu$ij7@solutions.solon.com>
  10. References: <4j06na$808@solutions.solon.com> <4jttan$3gf@solutions.solon.com>  <4jv6st$crf@solutions.solon.com> <4k1qh3$5hn@solutions.solon.com> <4keov7$8bk@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13. In article <4keov7$8bk@solutions.solon.com>, kanze@gabi-soft.fr (J. Kanze) writes:
  14.  
  15. |> *Normally*, any decent compiler will convert either of these idioms to
  16. |> whichever is fastest on that machine, although I do have memories of a
  17. |> Microsoft C compiler which converted the array notation to pointers,
  18. |> even though on the target machine (8086, large model), it could keep the
  19. |> (single) index in memory, but not the pointers.  (Turning off
  20. |> optimization resulted in a program that ran faster and was smaller.)
  21.  
  22. Chris Torek's very interesting posting <4kcmji$p13@solutions.solon.com>
  23. indicates that gcc on SPARC is a further counter-example.
  24.  
  25. |> What is obfuscation is using pointers when the original data is an array
  26. |> (or vice-versa).
  27.  
  28. In which situations would you use pointer arithmetic?
  29.  
  30. Konrad Schwarz
  31.